package top.lenjon.lib.mapper;

import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import top.lenjon.lib.entity.BookClassify;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
 * <p>
 * 分类 Mapper 接口
 * </p>
 *
 * @author wei
 * @since 2020-11-09
 */
@Repository
public interface BookClassifyMapper extends BaseMapper<BookClassify> {

    @Deprecated
    @Select({"<script>",
            "SELECT book_id FROM book_classify WHERE 1=1",
            "<when test='#{classify.gongYe}!=null'>AND gong_ye=1</when>",
            "<when test='#{classify.jingJi}!=null'>AND gong_ye=1</when>",
            "<when test='#{classify.keXue}!=null'>AND gong_ye=1</when>",
            "<when test='#{classify.wenHua}!=null'>AND gong_ye=1</when>",
            "<when test='#{classify.yuLe}!=null'>AND gong_ye=1</when>",
            "<when test='#{classify.zhengZhi}!=null'>AND gong_ye=1</when>",
            "<when test='#{classify.zongHe}!=null'>AND gong_ye=1</when>",
            "</script>"
    })
    List<Integer> getBookByClassify(BookClassify classify);
}
